home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / C de cerca / Codewarrior Lite / MacOS Support / Headers / ANSI Headers / assert.h < prev    next >
Text File  |  1995-12-29  |  1KB  |  52 lines

  1. /* assert.h standard header */
  2. #include <yvals.h>
  3.  
  4. #if __MWERKS__
  5. #pragma options align=mac68k
  6.  
  7. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  8. #pragma import on
  9. #endif
  10. #endif
  11.  
  12. #undef assert    /* remove existing definition */
  13.  
  14. #ifdef NDEBUG
  15.     #define assert(test)    ((void)0)
  16. #else            /* NDEBUG not defined */
  17. _C_LIB_DECL
  18.     void _Assert(char *);
  19. _END_C_LIB_DECL
  20.         /* macros */
  21.     #define _STR(x)    _VAL(x)
  22.     #define _VAL(x)    #x
  23. #ifdef _VERBOSE_DEBUGGING
  24. #include <stdio.h>
  25.     #define assert(test)    ((test) ? (void)fprintf( \
  26.         stderr, __FILE__ ":" _STR(__LINE__) " " #test " -- OK\n") \
  27.         : _Assert(__FILE__ ":" _STR(__LINE__) " " #test))
  28. #else
  29.     #define assert(test)    ((test) ? (void)0 \
  30.         : _Assert(__FILE__ ":" _STR(__LINE__) " " #test))
  31. #endif
  32.  
  33. #endif
  34.  
  35. #if __MWERKS__
  36. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  37. #pragma import reset
  38. #endif
  39.  
  40. #pragma options align=reset
  41. #endif
  42.  
  43. /*
  44.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  45.  * Consult your license regarding permissions and restrictions.
  46.  */
  47.  
  48. /* Change log:
  49.  *94June04 PlumHall baseline
  50.  *94Oct07 Inserted MW changes.
  51.  */
  52.